import {Vue, Watch} from "vue-property-decorator";
import {BaseParams} from "@/api/BaseParams";

export default class BaseListView extends Vue {
    params: BaseParams = new BaseParams();

    @Watch("$route")

    loadViewData() {
        console.log(this.$route.query)
        if (typeof this.$route.query.page == "string") {
            this.params.page = Number(this.$route.query.page);
            this.params.limit = Number(this.$route.query.limit);
            delete this.$route.query.limit;
            delete this.$route.query.page;
        }
        Object.assign(this.params, this.$route.query);
        this.$route.query.page = this.params.page.toString();
        this.$route.query.limit = this.params.limit.toString();

        this.loadData()
    }

    loadData() {
    }
}